<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/blogs.css">
</head>

<body>
    <h2>博客列表</h2>
    <input type="button" value="新增" onclick="btnAdd()">
    <table id="myTable">
        <thead>
        <tr>
            <th>Id</th>
            <th>标题</th>
            <th>作者</th>
            <th>发表时间</th>
            <th>描述</th>
            <th>操作</th>
        </tr>
    </thead>
        <tbody>
        {% for item in blogs %}
        <tr>
            <td>{{item.id}}</td>
            <td>{{item.title}}</td>
            <td>{{item.author}}</td>
            <td>{{item.publishedAt}}</td>
            <td>{{item.descriptions}}</td>
            <td>
                <input type="button" value="编辑" onclick="btnEdit('{{item.id}}')">
                <input type="button" value="删除" onclick="btnDel(`{{item.id}}`)">
            </td>
        </tr>

        {% endfor %}
    </tbody>
    </table>
    <div class="pagination">
        <button id="prevBtn" onclick="prevPage()">上一页</button>
        <span id="pageInfo"></span>
        <button id="nextBtn" onclick="nextPage()">下一页</button>
    </div>


    <script src="./js/blogs.js"></script>
</body>

</html>